package com.dcd.controller;

import com.dcd.pojo.Sales;
import com.dcd.service.SalesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SalesController {

    @Autowired
    private SalesService ss;

    /**
     * 查询近期前五个的日期
     * @return
     */
    @RequestMapping("/timeAll")
    public List<Sales> timeAll(){
        return ss.timeAll();
    }

    /**
     * 支付宝支付成功修改销量
     * @param sales_car_series_fk_id   车系id
     * @return
     */
    @RequestMapping("/paySales")
    public int paySales(@RequestParam Integer sales_car_series_fk_id){
        return ss.paySales(sales_car_series_fk_id);
    }

}
